[pipeline:main]
pipeline =
    tw2
    github2fedmsg

[filter:proxy-prefix]
use = egg:PasteDeploy#prefix
prefix = /github2fedmsg
scheme = https

[filter:tw2]
use = egg:tw2.core#middleware
#script_name = /
res_prefix = /github2fedmsg/resources

[app:github2fedmsg]
use = egg:github2fedmsg

filter-with = proxy-prefix

#pyramid.reload_templates = true
pyramid.default_locale_name = en
pyramid.includes =
    pyramid_tm

{% if env != 'staging' %}
sqlalchemy.url = postgresql://{{github2fedmsgDBUser}}:{{github2fedmsgDBPassword}}@db-github2fedmsg/github2fedmsg
{% else %}
sqlalchemy.url = postgresql://{{github2fedmsgStgDBUser}}:{{github2fedmsgStgDBPassword}}@db-github2fedmsg/github2fedmsg
{% endif %}

mako.directories=github2fedmsg:templates

{% if env != 'staging' %}
github.secret_oauth_access_token = {{github2fedmsg_gh_secret_oauth_access_token}}
velruse.github.consumer_key = {{github2fedmsg_gh_app_key}}
velruse.github.consumer_secret = {{github2fedmsg_gh_app_secret}}
velruse.github.scope = read:org,admin:repo_hook
velruse.openid.identifier = https://id.fedoraproject.org/
velruse.openid.realm = https://apps.fedoraproject.org/github2fedmsg
github.callback = https://apps.fedoraproject.org/github2fedmsg/webhook
github.secret = {{github2fedmsgGHSecret}}

session.secret="{{github2fedmsgSessionSecret}}"
authnsecret="{{github2fedmsgAuthnSecret}}"
{% else %}
github.secret_oauth_access_token = {{github2fedmsg_gh_secret_oauth_access_token_staging}}
velruse.github.consumer_key = {{github2fedmsg_gh_app_key_staging}}
velruse.github.consumer_secret = {{github2fedmsg_gh_app_secret_staging}}
velruse.github.scope = read:org,admin:repo_hook
velruse.openid.identifier = https://id.stg.fedoraproject.org/
velruse.openid.realm = https://apps.stg.fedoraproject.org/github2fedmsg
github.callback = https://apps.stg.fedoraproject.org/github2fedmsg/webhook
github.secret = {{github2fedmsgGHSecret_staging}}

session.secret="{{github2fedmsgStgSessionSecret}}"
authnsecret="{{github2fedmsgStgAuthnSecret}}"
{% endif %}

# Begin logging configuration

[loggers]
keys = root, github2fedmsg, sqlalchemy

[handlers]
keys = console

[formatters]
keys = generic

[logger_root]
level = INFO
handlers = console

[logger_github2fedmsg]
level = DEBUG
handlers =
qualname = github2fedmsg

[logger_sqlalchemy]
level = WARN
handlers =
qualname = sqlalchemy.engine
# "level = INFO" logs SQL queries.
# "level = DEBUG" logs SQL queries and results.
# "level = WARN" logs neither.  (Recommended for production systems.)

[handler_console]
class = StreamHandler
args = (sys.stderr,)
level = NOTSET
formatter = generic

[formatter_generic]
format = %(asctime)s %(levelname)-5.5s [%(name)s][%(threadName)s] %(message)s

# End logging configuration
